<template>
  <div class="footer">
    <p>我是footer</p>
    <p>count的值为{{ count }}</p>
    <button @click="decrement">累减</button>
    <button @click="waitIncrement">等等再加</button>
  </div>
</template>

<script>
import { mapMutations, mapState } from "vuex";
export default {
  name: "Footer",
  computed: {
    // mapState的数组写法
    ...mapState(["count"]),
  },
  methods: {
    ...mapMutations(["decrement","waitIncrement"]),
  },
};
</script>

<style scoped>
.footer {
  margin: 30px;
  background: yellowgreen;
}
</style>